import random
g=5000
print("金币余额：",g)
a=random.randint(1,100)
b=int(input("猜一个数字"))
while a!=b and g!=0:
    if(b>a):
        print("大了")
        g-=500
        print("金币余额：", g)
    elif(b<a):
        print("小了")
        g-=500
        print("金币余额：", g)
    b=int(input("猜一个数"))
    if(b==a):
        g+=3000
        print("恭喜猜中，本轮幸运数字：",a)
        print("金币余额：", g)
